<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "goods_attribute".
 *
 * @property int $goods_attr_id 自增ID
 * @property int $goods_id 商品ID
 * @property int $attr_id 属性ID
 * @property string $attr_value 属性值,用;号分割
 * @property float $attr_price 价格
 * @property int $count 库存
 *
 * @property Attribute $attr
 */
class GoodsAttribute extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'goods_attribute';
    }

    /**
     * Gets query for [[Attr]].
     *
     * @return \yii\db\ActiveQuery
     */
    public function getAttr()
    {
        return $this->hasOne(Attribute::className(), ['attr_id' => 'attr_id']);
    }
}
